//
//  ChooseGiftView.m
//  GiftNote
//
//  Created by wsh on 15/8/19.
//  Copyright (c) 2015年 GN. All rights reserved.
//
#import <UIKit/UIKit.h>

@protocol DorpDownChooseDelegate <NSObject>
@optional
- (void)chooseAtSection:(NSInteger)section index:(NSInteger)index;
@end



@protocol DorpDownChooseDataSource <NSObject>

// 展示标题section的个数
- (NSInteger)numberofSection;

// 每个标题的下拉菜单有多少个数据
- (NSInteger)numberofRowsInSection:(NSInteger)section;

// button标题下对应的数据的内容
- (NSString *)titleInSection:(NSInteger)section index:(NSInteger)index;

//  button初始化的标题
- (NSString *)firstTitleInSection:(NSInteger)section index:(NSInteger)index;

// 默认显示的section
- (NSInteger)defaultShowSection:(NSInteger)section;

@end


@interface DorpDownListView : UIView <UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout>

{
    NSInteger currentExtendSection; // 当前展开的section 默认-1时候 表示没有展开
}

// 代理属性
@property(nonatomic, assign) id<DorpDownChooseDelegate> DorpDownDelegate;
@property(nonatomic, assign) id<DorpDownChooseDataSource> DorpDownDataSourse;

@property(nonatomic, strong) UICollectionView *downCollectionView; // 展示下拉菜单的数据
@property(nonatomic, strong) UIView *alphaBgView; // 下拉菜单出现的透明背景
@property(nonatomic, strong) UIView *bigSuperView; // 表示的是控制器的View


- (instancetype)initWithFrame:(CGRect)frame datasourse:(id)datasourse delegate:(id)delegate;

// 将展开的View收起来
- (void)hideExtendChooseView;

// 判断当前是否有展示的View
- (BOOL)isShow;

// 给对应的button设置标题
- (void)setTitle:(NSString *)title inSection:(NSInteger)section;



@end


